<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>全部员工信息</title>
</head>
<body>
<div>
    <table border="1" width="1000">
        <tr>
            <th colspan="7">
                <a th:href="@{/emp/addPage}">添加员工</a>
            </th>
        </tr>
        <tr>
            <th colspan="7">全部员工信息</th>
        </tr>
        <tr>
            <th>员工编号</th>
            <th>员工姓名</th>
            <th>员工年龄</th>
            <th>员工性别</th>
            <th>员工创建日期</th>
            <th>员工所属部门编号</th>
            <th>操作</th>
        </tr>
        <tr th:each="emp : ${#request.getAttribute('empList')}">
            <td th:text="${emp.id}"></td>
            <td th:text="${emp.empName}"></td>
            <td th:text="${emp.empAge}"></td>
            <td th:text="${emp.empGender}"></td>
            <td th:text="${emp.createDate}"></td>
            <td th:text="${emp.deptId}"></td>
            <td>
                <a th:href="@{/emp/} + ${emp.id} + '/p'">查看</a>
                <a th:href="@{/emp/} + ${emp.id} + '/e'">修改</a>
                <form th:action="@{/emp/} + ${emp.id}" method="post">
                    <input type="hidden" name="_method" value="delete">
                    <input type="submit" value="删除">
                </form>
            </td>
        </tr>
    </table>
</div>
</body>
</html>